<!--定义分页请求地址，传递给backConstant.ftl-->
<#assign urllist="${rc.contextPath}/picture/pictureAdminViewList" />
<!--定义详情请求地址，传递给backConstant.ftl-->
<#assign urldetail="${rc.contextPath}/picture/detailPicture" />
<!--定义添加表单初始值请求地址，传递给backConstant.ftl-->
<#assign urladdforminit="${rc.contextPath}/picture/pictureFormInit" />
<!--定义保存实体变量地址，传递给backConstant.ftl-->
<#assign urlsave="${rc.contextPath}/picture/savePicture" />
<!--定义修改实体变量地址，传递给backConstant.ftl-->
<#assign urlupdate="${rc.contextPath}/picture/updatePicture" />
<!--定义删除实体变量地址，传递给backConstant.ftl-->
<#assign urldelete="${rc.contextPath}/picture/deletePicture" />
<#assign urltypedata="${rc.contextPath}/picture/typeJsonData">
<!--include常量-->
<#include "/misc/backConstant.ftl">

<script type="text/javascript">
		//设置分页表格的属性
		var paginationColumns = 
			[
			 {field:"type.name",title:"<@i18n.message "picturegallery.message.field.type"/>",width:50},
			 {field:"className",title:"<@i18n.message "picturegallery.message.field.className"/>",width:50},
			 {field:"fileAbsolutePath",title:"<@i18n.message "picturegallery.message.field.fileAbsolutePath"/>",width:50},
			 {field:"occurrenceTime",title:"<@i18n.message "picturegallery.message.field.occurrenceTime"/>",width:50},
			 {field:"createdate",title:"<@i18n.message "picturegallery.message.field.createdate"/>",width:50}
			];
		
				//查询
		function doSearch${currentActionName}(){
			$('#' + dg).datagrid('load',{
				"type.id": $('#typeStringSearchKey${currentActionName}').combobox('getValue')
		    });
		}
		
		//可以在这里扩充详情的显示
		function detailSet${currentActionName}(result){
		}
		
		$.get("${urltypedata}",function(result){
			var options = {
				data : result,
				textField:'${CoreConstants.VIEW_SELECT_LABEL_TEXT}',
				valueField:'${CoreConstants.VIEW_SELECT_LABEL_VALUE}'
			};
			$('#typeStringSearchKey${currentActionName}').combobox(options);
			$('#typeFormKey${currentActionName}').combobox(options);
		})
</script>
<script type="text/javascript" src="${rc.contextPath}/static/js/crud.js"></script>

<div style="padding:5px;">
	<table id="dg${currentActionName}"></table>
	<div id="toolbar${currentActionName}"  style="padding:5px;height:auto">
		<div style="margin-bottom:5px">
			<a href="#" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="openDetail('detail','${currentActionName}','${urldetail}')"><@i18n.message "button.detail"/></a>
			<a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="openAdd('dlg','fm','${currentActionName}','${urlsave}','${urladdforminit}')"><@i18n.message "button.add"/></a>
			<a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="openEdit('dlg','fm','${currentActionName}','${urlupdate}','${urldetail}')"><@i18n.message "button.edit"/></a>
			<a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="openDelete('${currentActionName}','${urldelete}')"><@i18n.message "button.delete"/></a>
		</div>
		<div>
			<input id="typeStringSearchKey${currentActionName}" class="easyui-textbox" data-options="prompt:'<@i18n.message "picturegallery.message.field.type"/>'"> &nbsp;&nbsp;
			<a href="#" class="easyui-linkbutton" iconCls="icon-search" onclick="doSearch${currentActionName}()"><@i18n.message "button.search"/></a>
		</div>
	</div>
	<div id="dlg${currentActionName}" class="easyui-dialog" closed="true" resizable="true" minimizable="true" collapsible="true" maximizable="true" style="width:35%;height:70%;padding:10px 20px"
			 buttons="#dlg-buttons${currentActionName}">
		<div class="ftitle"><@i18n.message "picturegallery.message.info"/></div>
			<@spring.form id="fm${currentActionName}" modelAttribute="vm" method="post">
				<div class="fitem">
					<label><@i18n.message "picturegallery.message.field.type"/>:</label>
					<input name="type.id" id="typeFormKey${currentActionName}" class="easyui-textbox" data-options="required:true,validType:['length[2,50]']" missingMessage='<@i18n.message "picturegallery.message.field.type"/>'>
				</div>
				<div class="fitem">
					<label><@i18n.message "picturegallery.message.field.className"/>:</label>
					<input name="className" id="classNameFormKey${currentActionName}" class="easyui-textbox"  missingMessage='<@i18n.message "picturegallery.message.field.className"/>'>
				</div>
				<div class="fitem">
					<label><@i18n.message "picturegallery.message.field.fileAbsolutePath"/>:</label>
					<input name="fileAbsolutePath" id="fileAbsolutePathFormKey${currentActionName}" class="easyui-textbox" missingMessage='<@i18n.message "picturegallery.message.field.fileAbsolutePath"/>'>
				</div>
					<input type="hidden" name="${CoreConstants.TOKEN_KEY}" id="${CoreConstants.TOKEN_KEY}${currentActionName}">
			</@spring.form>
		</div>

	</div>
	<div id="dlg-buttons${currentActionName}">
		<a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="save('dlg','fm','${currentActionName}','${urlsave}','${urlupdate}')"><@i18n.message "button.save"/></a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="cancelForm('dlg','fm','${currentActionName}')"><@i18n.message "button.cancel"/></a>
	</div>
	<div id="detail${currentActionName}" class="easyui-dialog" closed="true" resizable="true" minimizable="true" collapsible="true" maximizable="true" style="width:35%;height:70%;padding:10px 20px" buttons="#detail-buttons${currentActionName}">
		<div class="ftitle"><@i18n.message "picturegallery.message.info"/></div>
		<table class="window_table">
			<tr>
				<td><@i18n.message "picturegallery.message.field.type"/>:</td>
				<td><label id="type_name${currentActionName}"></label></td>
			</tr>
			<tr>
				<td><@i18n.message "picturegallery.message.field.className"/>:</td>
				<td><label id="className${currentActionName}"></label></td>
			</tr>
			<tr>
				<td><@i18n.message "picturegallery.message.field.fileAbsolutePath"/>:</td>
				<td><label id="fileAbsolutePath${currentActionName}"></label></td>
			</tr>
			<tr>
				<td><@i18n.message "picturegallery.message.field.createdate"/>:</td>
				<td><label id="createdate${currentActionName}"></label></td>
			</tr>
		</table>
	</div>
	
	
	<div id="detail-buttons${currentActionName}">
		<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="cancelForm('detail',null,'${currentActionName}')"><@i18n.message "button.closed"/></a>
	</div>
</div>